import React, { Component } from 'react';

class UnreadMsg extends Component{
    constructor(){
        super();
        this.state={
            count:1
        };
    }

    renderText(exist,notExist){
        const existMsg = false;
        return existMsg ? exist : notExist;
    }

    render(){
        return (
            <div>
                {this.renderText(
                    <span>您有{this.state.count}条未读消息</span>,
                    <span>当前没有未读消息</span>
                )}
            </div>
        );
    }
}

export default UnreadMsg;